﻿@inject IStringLocalizer<Foo> LocalizerFoo

<Table TItem="Foo"
        Items="@Items.Take(4)"
        RenderMode="TableRenderMode.Table"
        HeaderStyle="TableHeaderStyle.Light"
        IsBordered="true"
        IsStriped="true" class="table-fix-column-demo">
    <TableColumns>
        <TableColumn @bind-Field="@context.Name" Width="100" Fixed="true" />
        <TableColumn @bind-Field="@context.DateTime" Width="180" Fixed="true" Filterable="true" />
        <TableColumn @bind-Field="@context.Address" Width="900" Filterable="true" />
        <TableColumn @bind-Field="@context.Education" Width="100" Filterable="true" />
        <TableColumn @bind-Field="@context.Count" Width="100" Filterable="true" />
        <TableColumn @bind-Field="@context.Complete" Width="100" Fixed="true" Filterable="true" />
    </TableColumns>
</Table>

@code {
    /// <summary>
    /// Foo 类为Demo测试用，如有需要请自行下载源码查阅
    /// Foo class is used for Demo test, please download the source code if necessary
    /// https://gitee.com/LongbowEnterprise/BootstrapBlazor/blob/main/src/BootstrapBlazor.Shared/Data/Foo.cs
    /// </summary>
    [NotNull]
    private List<Foo>? Items { get; set; }

    /// <summary>
    /// OnInitialized method
    /// </summary>
    protected override void OnInitialized()
    {
        base.OnInitialized();

        Items = Foo.GenerateFoo(LocalizerFoo);
    }
}
